%% monashwp style for LaTeX2e.
%% version 2.1
%% By Rob J. Hyndman. 24 March 2010
%%
%% This style file is for working papers published by
%% the Department of Econometrics & Business Statistics
%% at Monash University, Australia.
%% All required packages are on CRAN.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{monashwp}
          [2009/10/22 v2.00]

%% Page dimensions
%\RequirePackage[a4paper,centering,text={16cm,24cm}]{geometry}
\RequirePackage[letterpaper,centering,text={6.5in,9.0in}]{geometry}
%% CAPTIONS
\RequirePackage{caption}
\DeclareCaptionStyle{italic}[justification=centering]
 {labelfont={bf},textfont={it},labelsep=colon}
\captionsetup[figure]{style=italic,format=hang,singlelinecheck=true}
\captionsetup[table]{style=italic,format=hang,singlelinecheck=true}

%% FONT
%\RequirePackage{kpfonts}
\RequirePackage{amsfonts}
%\RequirePackage{bera}
%\RequirePackage[charter,expert,sfscaled]{mathdesign}

%% HEADERS AND FOOTERS
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\rfoot{\Large\sf\raisebox{-0.1cm}{\textbf{\thepage}}}
\lhead{\textsf{\expandafter{\@title}}}
\rhead{}
\cfoot{}
\setlength{\headheight}{15pt}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\sf\thepage} % except the center
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

%% MATHS
\RequirePackage{bm,amsmath}
\allowdisplaybreaks

%% GRAPHICS
\RequirePackage{graphicx}
\setcounter{topnumber}{2}
\setcounter{bottomnumber}{2}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\textfraction}{0.15}
\renewcommand{\floatpagefraction}{0.7}

%% SECTION TITLES
\RequirePackage[sf,bf]{titlesec}
%\titleformat*{\subsection}{\large,sf,bfshape}
\titlespacing{\section}{0pt}{3ex}{1ex}
\titlespacing{\subsection}{0pt}{2ex}{1ex}
\titlespacing{\subsubsection}{0pt}{1ex}{0ex}
\titleformat{\subsubsection}{\bf}{}{0ex}{}

%% TITLE PAGE
\def\Date{\number\day}
\def\Month{\ifcase\month\or
 January\or February\or March\or April\or May\or June\or
 July\or August\or September\or October\or November\or December\fi}
\def\Year{\number\year}
\def\wp#1{\gdef\@wp{#1}}\def\@wp{??/??}
\def\jel#1{\gdef\@jel{#1}}\def\@jel{??}
\def\showjel{{\large\textsf{\textbf{JEL classification:}}~\@jel}}
\def\nojel{\def\showjel{}}
\def\addresses#1{\gdef\@addresses{#1}}\def\@addresses{??}
\def\cover{{\sf\setcounter{page}{0}
        \thispagestyle{empty}%
        \vspace*{-2cm}
        %\rightline{ISSN 1440-771X}\vspace{0.5cm}
        \begin{center}\Large
%        \includegraphics[width=14cm]{monash1line}\\
%        Department of Econometrics and Business Statistics\\
%        \large http://www.buseco.monash.edu.au/depts/ebs/pubs/wpapers/
%        \end{center}\vspace{2cm}
%        \includegraphics[width=14cm]{monash1line}\\
        \includegraphics[width=4cm]{gtc-drtcbear150}\\
        Green Trees Consulting\\
        \large http://www.afn.org/$\sim$mathstat/ \\
	\huge Working Papers \\
	\huge in \\
	\huge Professional Caregiver Insurance Risk \\
        \end{center}\vspace{2cm}
        \begin{center}
        \fbox{\parbox{14cm}{\begin{onehalfspace}\centering\Huge\vspace*{0.3cm}
                \textsf{\textbf{\expandafter{\@title}}}\vspace{1cm}\par
                \LARGE\@author\end{onehalfspace}
        }}
        \end{center}
        \vfill
                \begin{center}\Large
                \Month~\Year\\[1cm]
                Working Paper \@wp
        \end{center}}}
\def\pageone{{\sf
        \newpage%\blankpage
        \thispagestyle{empty}\raggedright\baselineskip=1.2cm
     {\fontsize{24.88}{30}\sf\textbf{\expandafter{\@title}}}
        \vspace*{2cm}\par
        \hspace*{1cm}\parbox{14cm}{\sf\large\@addresses}\vfill
        \hspace*{1cm}{\large\Date~\Month~\Year}\\[1cm]
        \hspace*{1cm}\showjel}}
\def\blindtitle{{\sf
     \thispagestyle{plain}\raggedright\baselineskip=1.2cm
     {\fontsize{24.88}{30}\sf\textbf{\expandafter{\@title}}}\vspace{1cm}\par
        }}
\def\titlepage{{\cover\newpage\setstretch{1}\pageone\newpage\blindtitle}}

\def\blind{\def\titlepage{{\blindtitle}}}
\def\titlepageonly{\def\titlepage{{\pageone\end{document}}}}
\def\nocover{\def\titlepage{{\newpage\pageone\newpage\blindtitle}}}


%% SPACING
\RequirePackage{setspace}
\spacing{1.5}

%% LINE AND PAGE BREAKING
\sloppy
\clubpenalty = 10000
\widowpenalty = 10000
\brokenpenalty = 10000
\RequirePackage{microtype}

%% BIBLIOGRAPHY
%\RequirePackage{natbib}
%\bibliographystyle{agsm}

%% PARAGRAPH BREAKS
\setlength{\parskip}{1.4ex}
\setlength{\parindent}{0em}

%% HYPERLINKS
\RequirePackage{xcolor} % Needed for links
\definecolor{darkblue}{rgb}{0,0,.6}
\RequirePackage{url}
\RequirePackage[citecolor=0 0 0,colorlinks=false]{hyperref}
\hypersetup{
     breaklinks=true,
     bookmarksopen=true,
     bookmarksnumbered=true,
     linkcolor=darkblue,
     urlcolor=blue,
     citecolor=darkblue,
     colorlinks=true}

%% KEYWORDS
\newenvironment{keywords}{\vspace{0.75cm}\noindent{\sf\textbf{Keywords:}}}{}

%% ABSTRACT
\renewenvironment{abstract}{\begin{minipage}{\textwidth}\parskip=1.4ex\noindent{\sf\textbf{\abstractname}}\\}
  {\end{minipage}}

